package com.iplay.service.query;

import com.iplay.service.query.Query.QueryTreeNodeValue;

public class QueryCondition implements QueryTreeNodeValue{
	private String key;
	private Operator operator;
	private Object value;

	/**
	 * The default operator is equal
	 * 
	 * @param key
	 * @param value
	 */
	public QueryCondition(String key, Object value) {
		super();
		this.key = key;
		this.value = value;
		this.operator = Operator.EQ;
	}

	public QueryCondition(String key, Operator operator, Object value) {
		super();
		this.key = key;
		this.operator = operator;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Operator getOperator() {
		return operator;
	}

	public void setOperator(Operator operator) {
		this.operator = operator;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public static enum Operator {
		EQ, GT, GE, LT, LE, IN, LIKE
	}
}
